package com.qf.team2.netdisc.dao;


import com.qf.team2.netdisc.common.pojo.entity.Document;
import com.qf.team2.netdisc.common.pojo.entity.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

/*@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:spring-context.xml"
        , "classpath:spring-druid.xml"
        , "classpath:spring-mybatis.xml"})
@WebAppConfiguration*/
/*public class fileText {
    @Autowired
    private DocumentUnploadMapper documentUnploadMapper;
    @Autowired
    private FileUnploadService fileUnploadService;
    @Autowired
    private DocumentDeleteMapper documentDeleteMapper;
    @Autowired
    private DocumentInsertMapper documentInsertMapper;
    @Autowired
    private FileInsertService fileInsertService;
    @Test
    public void text() {
        Integer fileId=3;
        Document file=documentUnploadMapper.selectDocumentByFileId(fileId);
        System.out.println(file);
        String route=file.getName();
        Integer filesId=file.getParentId();
        while (filesId!=null){
            Document file1=documentUnploadMapper.selectDocumentByFileId(filesId);
            filesId=file1.getParentId();
            route=file1.getName()+"\\"+route;
        }
        System.out.println(route);


    }
    @Test
    public void text1(){
        Document document=new Document();
        document.setName("123");
        document.setId(1);
        document.setParentId(1);
        document.setIsDirectory(0);
        document.setIsRoot(0);
        Document document1=documentUnploadMapper.insertFile(document.getName(),document.getId(),document.getParentId(),document.getIsDirectory(),document.getIsRoot());
        System.out.println(document1);


    }
    @Test
    public void text2(){
        Integer ID=1;
        User user=documentUnploadMapper.selectDocumentById(ID);
        System.out.println(user);
    }
    @Test
    public void text3(){
        *//*Integer integer=documentUnploadMapper.upadteById(13, 2, 1);
        System.out.println(integer);*//*
        Integer integer1=fileUnploadService.upadteParentFileSize(13, 2, 1);
        System.out.println(integer1);
       *//* Document document=documentUnploadMapper.selectDocumentByFileId(1, 2);
        System.out.println(document);*//*
    }
    @Test
    public void text4(){
        Document document1=new Document();
        document1.setName("abc");
        Document document=documentUnploadMapper.insertFile(document1.getName(),1,1, 1, 1, 1);
        System.out.println(document);
    }
    @Test
    public void text5(){

       *//* String s=fileUnploadService.checkFilePath(17,2);
        System.out.println(s);*//*
        String name="ls1234";
        Integer id=1234562;
        Integer integer=fileInsertService.FileInsert(name,id);



    }*/

